const joi = require('joi')

// 用户名的验证规则
const username = joi.string().alphanum().min(1).max(10).required()
// 用户密码的验证规则
const password = joi.string().pattern(/^\S{6,12}$/).required()
//添加讲师的验证规则
const name= joi.string().required()
const avatar = joi.string().required()
const career = joi.string().required()
const level = joi.number().required()
const intro = joi.string().required()
const join_date = joi.date().required()
const sort = joi.number().required()


// 登录
exports.reg_userLogin = {
  // body query params
  body: {
    username, password
  }
}
// 添加讲师
exports.add_teacher = {
  body: {
    name, join_date, sort, level, intro, career, avatar
  }
}
